<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>购物车</title>
    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap.min.css" rel="stylesheet">
</head>


<body>
    <div style="text-align: right;">
        <a href="/course"><button>课程表</button></a>
        <br><br>
    </div>
    <form action="/buy" method="post">
        <div class="row">
            <div class="col-md-2"></div>
            {%for item in product_list%}
            <div class="col-md-3 col-sm-6 service"><img src="{{item.img}}">
                <h4><strong>{{item.name}}</strong>&nbsp;￥{{item.price}}</h4>
                <input type="number" name="{{item.id}}" value="0" min="0" />
            </div>
            {% endfor %}
            <div class="col-md-2"></div>
        </div>
        <div style="text-align: center;">
            <br>
            余额:<input type="number" name="money" value="" min="0" />
            <input type="submit" name="buy" value=" 立即购买 " />
        </div>
    </form>
    {%if ts!=''%}
    <script>alert('{{ts}}');</script>
    {%endif%}
</body>